{% extends 'base.html' %}

{% block title %}
    {% if form.instance.pk %}编辑仓库{% else %} 新增仓库% {% endif %}
{% endblock %}

{% block content %}
<div class="row">
    <div class="col=4">
        <h1 class="mt-4">{% if form.instance.pk %}编辑仓库{% else %} 新增仓库 {% endif %}</h1>
        <form method="post">
            {% csrf_token %}
            <div class="mb-3">
                <label for="id_name" class="foem-label">{{ form.name.label }}</label>
                {{ form.name }}
                {% if form.name.errors %}
                    <div class="text-danger">
                        {{ form.name.errors }}
                    </div>
                {% endif %}
            </div>
            <button type="submit" class="btn btn-primary">保存</button>
            <a href="{% url 'warehouses_list' %}" class="btn btn-secondary">取消 </a>
        </form>

    </div>
</div>

{% endblock %} 